﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Brjostagjof_H4.Models.ContactUs>>" %>    

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
		Brjóstagjöf.is | Ábendingar
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h3>Ábendingar</h3>
    <table id="main-table">
        <tr>
        <td id="main-table-left">
        <% if (Model.Count() > 0)
        { %>
            <table>
                <tr>
                    <th></th>
                     <th>
                        Fyrirsögn
                    </th>
                     <th>
                        Ábending
                    </th>   
                    <th>
                        Netfang
                    </th>         
                    <th>
                        Hvenær sent
                    </th>
                </tr>

            <% foreach (var item in Model) { %>
    
                <tr>
                    <td >
                        <%: Html.ActionLink("Sjá Nánar", "ContactUsShowDetail", new { id=item.ID })%> |
                        <%: Html.ActionLink("Eyða","ContactUsDelete",new { id = item.ID } ) %>
                    </td>
                    <td>
                        <%: item.subj %>
                    </td>
                    <td>
                        <%: item.txt %>
                    </td>    
                    <td>
                        <%: item.email %>
                    </td>        
                    <td>
                        <%: String.Format("{0:g}", item.posted) %>
                    </td>
                </tr>   
            <% } %>

            </table>
         <% }
            else
            { %>
                <p>Engar nýjar ábendingar.</p>
         <% } %>
                <p> <%: Html.ActionLink("Skoða eldri ábendingar", "ContactUsOld", "Home")%></p>
                </td>

                <td id="main-table-right">
                <div class="options">
                    <% if (User.IsInRole("Administrators")){Html.RenderPartial("~/Views/Home/ProfileAdminMenu.ascx", "Model");} %>
                    <% else if (User.IsInRole("Professionals")) { Html.RenderPartial("~/Views/Home/ProfileProMenu.ascx", "Model"); } %>
                    <% else { Html.RenderPartial("~/Views/Home/ProfileMenu.ascx", "Model"); } %>
                </div>
                </td>

            </tr>
    </table>

    </asp:Content>

